package com.zhiqianbao.activity;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.TypedValue;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.zhiqianbao.R;
import com.zhiqianbao.entity.LoanApply;
import com.zhiqianbao.entity.LoanStatus;
import com.zhiqianbao.entity.Result;
import com.zhiqianbao.utils.CheckUtils;
import com.zhiqianbao.utils.Constants;
import com.zhiqianbao.utils.HttpUtils;
import com.zhiqianbao.utils.LoanConstants;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import cn.trinea.android.common.util.StringUtils;

/**
 * Created by liang on 2016/2/25.
 */
public class ProgessApplySingleActivity extends BaseActivity implements View.OnClickListener{

    //进度查询相关view控件
    ScrollView srcollviewContainerItem2;
    /**
     * 借款金额
     */
    TextView textViewBorrowBalanceContent;
    /**
     * 借款期限
     */
    TextView textViewLifeOfLoanContent;
    /**
     * 提交申请时间显示
     */
    TextView sjTjsqText;
    /**
     * 综合评估进行中图片
     */
    ImageView jdZhpgjxzImg;
    /**
     * 综合评估进行中竖线
     */
    ImageView sxZhpgjxzImg;
    /**
     * 综合评估进行中时间
     */
    TextView sjZhpgjxzText;
    /**
     * 审核确认进行中图片
     */
    ImageView jdShqrjxzImg;
    /**
     * 标题
     */
    TextView jdShqrjxzTitle;
    /**
     * 审核确认进行中的竖线
     */
    ImageView sxShqrjxzImg;
    /**
     * 审核确认进行中的时间显示
     */
    TextView sjShqrjxzText;
    /**
     * 发放贷款资金中图片
     */
    ImageView jdFfjdzjzImg;
    /**
     * 发放贷款资金中竖线
     */
    ImageView sxFfjdzjzImg;
    /**
     * 发放贷款资金中时间显示
     */
    TextView sjFfjdzjzText;
    /**
     * 标题
     */
    TextView jdFfjdzjzTitle;
    /**
     * 已经完成图片
     */
    ImageView jdYwjImg;
    /**
     * 标题
     */
    TextView jdYwjTitle;
    /**
     * 取消时间
     */
    TextView sjYqxText;
    /**
     * 取消按钮
     */
    Button buttonCancelRequest;
    /**
     * 没有借款信息需要显示
     */
    TextView textviewDataNull;

    /**
     * 借款详情
     */
    RelativeLayout loanApplyInfoRelativeLayout;

    LoanApply loanApply;
    LoanStatus loanStateTime;


    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    Handler applyProgressHandler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case 1 :
                    int underHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 17, getResources().getDisplayMetrics());
                    int underWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 17, getResources().getDisplayMetrics());
                    int ohterHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 17, getResources().getDisplayMetrics());
                    int ohterWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 17, getResources().getDisplayMetrics());
                    int underLeft = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 15, getResources().getDisplayMetrics());
                    int ohterLeft = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 15, getResources().getDisplayMetrics());

                    LinearLayout.LayoutParams underMarginLeft = new LinearLayout.LayoutParams(underWidth, underHeight);
                    underMarginLeft.setMargins(underLeft, 0, 0, 0);
                    LinearLayout.LayoutParams ohterMarginLeft = new LinearLayout.LayoutParams(ohterWidth, ohterHeight);
                    ohterMarginLeft.setMargins(ohterLeft, 0, 0, 0);


                    //通过查询的进度详情，显示处理
                    loanApply = (LoanApply) msg.obj;
                    //如果不存在借款信息 显示没有借款
                    if (null == loanApply) {
                        textviewDataNull.setVisibility(View.VISIBLE);
                        srcollviewContainerItem2.setVisibility(View.GONE);
                        closeWaitDialog();
                        return;
                    }else {
                        textviewDataNull.setVisibility(View.GONE);
                        srcollviewContainerItem2.setVisibility(View.VISIBLE);
                    }
                    loanStateTime = loanApply.getLoanStateTime();

                    //显示借款信息
                    textViewBorrowBalanceContent.setText(loanApply.getAmount().intValue() + "");
                    textViewLifeOfLoanContent.setText(loanApply.getTerm() + "");
                    //状态
                    String loanState = loanApply.getState();
                    //判断状态，进行显示
                    //刚刚提交申请状态
                    if (LoanConstants.LOAN_APPLY_CONFIRM.equals(loanState) ||
                            LoanConstants.LOAN_AUDIT_WAITING.equals(loanState) ||
                            LoanConstants.LOAN_AUDIT_CONFIRM_FAIL.equals(loanState) ||
                            LoanConstants.LOAN_FINANCE_AUDIT_FAIL.equals(loanState)) {

                        //取消按钮显示状态
                        buttonCancelRequest.setBackgroundResource(R.drawable.btn_request_normal_background);
                        buttonCancelRequest.setClickable(true);
                        buttonCancelRequest.setTextColor(Color.parseColor("#D2422F"));



                        //显示提交时间
                        Long tjsqTime = loanStateTime.getApplyConfirmTime();
                        String tjsqTimeStr = sdf.format(new Date(tjsqTime));
                        sjTjsqText.setText(tjsqTimeStr);
                        //综合评估进行中 显示
                        jdZhpgjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);
                        jdZhpgjxzImg.setLayoutParams(underMarginLeft);
                        sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_underway);
                        sjZhpgjxzText.setText("");
                        //审核确认进行中 显示
                        jdShqrjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);
                        jdShqrjxzImg.setLayoutParams(ohterMarginLeft);
                        sxShqrjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        sjShqrjxzText.setText("");
                        jdShqrjxzTitle.setTextColor(Color.parseColor("#ffD9D9D9"));
                        //发放贷款
                        jdFfjdzjzImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);
                        jdFfjdzjzImg.setLayoutParams(ohterMarginLeft);
                        sxFfjdzjzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        sjFfjdzjzText.setText("");
                        jdFfjdzjzTitle.setTextColor(Color.parseColor("#ffD9D9D9"));
                        //已完结
                        jdYwjImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);
                        jdYwjTitle.setTextColor(Color.parseColor("#ffD9D9D9"));

                        //显示 审核确认进行中
                    } else if (LoanConstants.LOAN_AUDIT_SUCCESS.equals(loanState)) {

                        //取消按钮显示状态
                        buttonCancelRequest.setBackgroundResource(R.drawable.activity_apply_index_want_to_express_normal_icon);
                        buttonCancelRequest.setClickable(false);
                        buttonCancelRequest.setTextColor(Color.parseColor("#FFFFFF"));

                        //显示提交时间
                        Long tjsqTime = loanStateTime.getApplyConfirmTime();
                        String tjsqTimeStr = sdf.format(new Date(tjsqTime));
                        sjTjsqText.setText(tjsqTimeStr);
                        //综合评估进行中 显示
                        Long zhpgTime = loanStateTime.getAuditTime();
                        String zhpgTimeStr = sdf.format(new Date(zhpgTime));
                        jdZhpgjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdZhpgjxzImg.setLayoutParams(ohterMarginLeft);
                        sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_apfter);
                        sjZhpgjxzText.setText(zhpgTimeStr);
                        //审核确认进行中 显示
                        jdShqrjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);
                        jdShqrjxzImg.setLayoutParams(underMarginLeft);
                        sxShqrjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_underway);
                        sjShqrjxzText.setText("");
                        jdShqrjxzTitle.setTextColor(Color.parseColor("#ff666666"));
                        //发放贷款
                        jdFfjdzjzImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);

                        jdFfjdzjzImg.setLayoutParams(ohterMarginLeft);
                        sxFfjdzjzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        sjFfjdzjzText.setText("");
                        jdFfjdzjzTitle.setTextColor(Color.parseColor("#ffD9D9D9"));
                        //已完结
                        jdYwjImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);
                        jdYwjTitle.setTextColor(Color.parseColor("#ffD9D9D9"));
                        //显示 发放贷款资金中
                    } else if (LoanConstants.LOAN_AUDIT_CONFIRM_SUCCESS.equals(loanState) ||
                            LoanConstants.LOAN_FINANCE_AUDIT_SUCCESS.equals(loanState)) {

                        //取消按钮显示状态
                        buttonCancelRequest.setBackgroundResource(R.drawable.activity_apply_index_want_to_express_normal_icon);
                        buttonCancelRequest.setClickable(false);
                        buttonCancelRequest.setTextColor(Color.parseColor("#FFFFFF"));

                        //显示提交时间
                        Long tjsqTime = loanStateTime.getApplyConfirmTime();
                        String tjsqTimeStr = sdf.format(new Date(tjsqTime));
                        sjTjsqText.setText(tjsqTimeStr);
                        //综合评估进行中 显示
                        Long zhpgTime = loanStateTime.getAuditTime();
                        String zhpgTimeStr = sdf.format(new Date(zhpgTime));
                        jdZhpgjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdZhpgjxzImg.setLayoutParams(ohterMarginLeft);
                        sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_apfter);
                        sjZhpgjxzText.setText(zhpgTimeStr);
                        //审核确认进行中 显示
                        Long shqrTime = loanStateTime.getAuditConfirmTime();
                        String shqrTimeStr = sdf.format(new Date(shqrTime));
                        jdShqrjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdShqrjxzImg.setLayoutParams(ohterMarginLeft);
                        sxShqrjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_apfter);
                        sjShqrjxzText.setText(shqrTimeStr);
                        jdShqrjxzTitle.setTextColor(Color.parseColor("#ff666666"));
                        //发放贷款
                        jdFfjdzjzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdFfjdzjzImg.setLayoutParams(underMarginLeft);
                        sxFfjdzjzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_underway);
                        sjFfjdzjzText.setText("");
                        jdFfjdzjzTitle.setTextColor(Color.parseColor("#ff666666"));
                        //已完结
                        jdYwjImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);
                        jdYwjTitle.setTextColor(Color.parseColor("#ffD9D9D9"));

                        //显示 已经完结
                    } else if (LoanConstants.LOAN_GRANT_FUNDS_SUCCESS.equals(loanState)) {

                        //取消按钮显示状态
                        buttonCancelRequest.setBackgroundResource(R.drawable.activity_apply_index_want_to_express_normal_icon);
                        buttonCancelRequest.setClickable(false);
                        buttonCancelRequest.setTextColor(Color.parseColor("#FFFFFF"));

                        //显示提交时间
                        Long tjsqTime = loanStateTime.getApplyConfirmTime();
                        String tjsqTimeStr = sdf.format(new Date(tjsqTime));
                        sjTjsqText.setText(tjsqTimeStr);
                        //综合评估进行中 显示
                        Long zhpgTime = loanStateTime.getAuditTime();
                        String zhpgTimeStr = sdf.format(new Date(zhpgTime));
                        jdZhpgjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdZhpgjxzImg.setLayoutParams(ohterMarginLeft);
                        sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_apfter);
                        sjZhpgjxzText.setText(zhpgTimeStr);
                        //审核确认进行中 显示
                        Long shqrTime = loanStateTime.getAuditConfirmTime();
                        String shqrTimeStr = sdf.format(new Date(shqrTime));
                        jdShqrjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdShqrjxzImg.setLayoutParams(ohterMarginLeft);
                        sxShqrjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_apfter);
                        sjShqrjxzText.setText(shqrTimeStr);
                        jdShqrjxzTitle.setTextColor(Color.parseColor("#ff666666"));
                        //发放贷款
                        Long ffdkTime = loanStateTime.getGrantFundsTime();
                        String ffdkTimeStr = sdf.format(new Date(ffdkTime));
                        jdFfjdzjzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdFfjdzjzImg.setLayoutParams(ohterMarginLeft);
                        sxFfjdzjzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_apfter);
                        sjFfjdzjzText.setText(ffdkTimeStr);
                        jdFfjdzjzTitle.setTextColor(Color.parseColor("#ff666666"));
                        //已完结
                        jdYwjImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);
                        jdYwjTitle.setTextColor(Color.parseColor("#ff666666"));
                        //显示不正常完结
                    } else if (LoanConstants.LOAN_APPLY_CANCEL.equals(loanState) ||
                            LoanConstants.LOAN_AUDIT_FAIL.equals(loanState) ||
                            LoanConstants.LOAN_AUDIT_CANCEL.equals(loanState)) {

                        //取消按钮显示状态
                        buttonCancelRequest.setBackgroundResource(R.drawable.activity_apply_index_want_to_express_normal_icon);
                        buttonCancelRequest.setClickable(false);
                        buttonCancelRequest.setTextColor(Color.parseColor("#FFFFFF"));

                        //显示提交时间
                        Long tjsqTime = loanStateTime.getApplyConfirmTime();
                        String tjsqTimeStr = sdf.format(new Date(tjsqTime));
                        sjTjsqText.setText(tjsqTimeStr);
                        //综合评估进行中 显示
                        jdZhpgjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);

                        jdZhpgjxzImg.setLayoutParams(underMarginLeft);
                        sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_underway);
                        sjZhpgjxzText.setText("");
                        //审核确认进行中 显示
                        jdShqrjxzImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);

                        jdShqrjxzImg.setLayoutParams(ohterMarginLeft);
                        sxShqrjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        sjShqrjxzText.setText("");
                        jdShqrjxzTitle.setTextColor(Color.parseColor("#ffD9D9D9"));
                        //发放贷款
                        jdFfjdzjzImg.setImageResource(R.drawable.i_img_first_info_confirm_before_icon);

                        jdFfjdzjzImg.setLayoutParams(ohterMarginLeft);
                        sxFfjdzjzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        sjFfjdzjzText.setText("");
                        jdFfjdzjzTitle.setTextColor(Color.parseColor("#ffD9D9D9"));
                        //已完结
                        jdYwjImg.setImageResource(R.drawable.i_img_first_info_confirm_underway_icon);
                        jdYwjTitle.setTextColor(Color.parseColor("#ff666666"));
                        //用户取消
                        if (LoanConstants.LOAN_APPLY_CANCEL.equals(loanState)) {
                            Long cancelTime = loanStateTime.getCancelTime();
                            if (cancelTime != null) {
                                String cancelTimeStr = sdf.format(new Date(cancelTime));
                                sjYqxText.setText(cancelTimeStr);
                            }
                            jdYwjTitle.setText("申请已取消");
                            sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        } else if (LoanConstants.LOAN_AUDIT_CANCEL.equals(loanState)){
                            Long cancelTime = loanStateTime.getCancelTime();
                            if (cancelTime != null) {
                                String cancelTimeStr = sdf.format(new Date(cancelTime));
                                sjYqxText.setText(cancelTimeStr);
                            }
                            jdYwjTitle.setText("审核取消");
                            sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        } else if (LoanConstants.LOAN_AUDIT_FAIL.equals(loanState)) {
                            Long cancelTime = loanStateTime.getCancelTime();
                            if (cancelTime != null) {
                                String cancelTimeStr = sdf.format(new Date(cancelTime));
                                sjYqxText.setText(cancelTimeStr);
                            }
                            jdYwjTitle.setText("审核拒绝");
                            sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        } else {
                            sjYqxText.setText("");
                            jdYwjTitle.setText("已完结");
                            sxZhpgjxzImg.setImageResource(R.drawable.i_img_apply_index_vertical_line_before);
                        }
                    }
                    break;
                case 0 :
                    showShortToast1(Constants.HTTP_ERROR_MESSAGE);
                    break;
            }
            closeWaitDialog();
        }
    };

    Handler cancelLoanApplyHandle = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case 0 :
                    showShortToast1(Constants.HTTP_ERROR_MESSAGE);
                    break;
                case 1 :
                    Result data = (Result) msg.obj;
                    if(data!=null) {
                        if (data.getCode().equals(Constants.DEFAULT_SUCCESS_CODE)) {
                            showShortToast1(data.getMsg());
                            checkLoanApply();
                        } else {
                            showShortToast1(data.getMsg());
                        }
                    }
                    break;
            }
        }
    };

    private void checkLoanApply() {
        new Thread(new Runnable() {
            @Override
            public void run() {
                Message message = new Message();
                Map<String, String> param = new HashMap<>();
                param.put("token", Constants.LOGIN_USER != null ? Constants.LOGIN_USER.getToken() : "");
                param.put("userId",Constants.LOGIN_USER != null ? Constants.LOGIN_USER.getId() + "" : "");
                String result = HttpUtils.httpPostString(Constants.API_ROOT + "/loan/getNewLoanApply", param, ProgessApplySingleActivity.this);
                if (StringUtils.isBlank(result)) {
                    message.what = 0;
                } else {
                    message.what = 1;
                    Result<LoanApply> data = Result.fromJson(result, LoanApply.class);
                    message.obj = data.getData();
                }
                applyProgressHandler.sendMessage(message);

            }
        }).start();
    }

    private void cancelLoanApply() {
        //调用取消按钮接口
        new Thread(new Runnable() {
            @Override
            public void run() {
                Message cancelMessage = new Message();
                Map<String, String> param = new HashMap<>();
                param.put("token", Constants.LOGIN_USER.getToken());
                param.put("userId", Constants.LOGIN_USER.getId() + "");
                param.put("loanApplyId", loanApply.getId() + "");
                String result = HttpUtils.httpPostString(Constants.API_ROOT + "/loan/cancelRegistration", param, ProgessApplySingleActivity.this);

                if (StringUtils.isBlank(result)) {
                    cancelMessage.what = 0;
                } else {
                    cancelMessage.what = 1;
                    Result data = Result.fromJson(result, HashMap.class);
                    cancelMessage.obj = data;
                }
                cancelLoanApplyHandle.sendMessage(cancelMessage);
            }
        }).start();

    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_progess_apply_single);
        init();
        initView();

    }

    private void initView() {
         srcollviewContainerItem2=(ScrollView)findViewById(R.id.srcollview_container_item2);
         textViewBorrowBalanceContent=(TextView)findViewById(R.id.textView_borrow_balance_content);
         textViewLifeOfLoanContent=(TextView)findViewById(R.id.textView_life_of_loan_content);
         sjTjsqText=(TextView)findViewById(R.id.sj_tjsq_text);
         jdZhpgjxzImg=(ImageView)findViewById(R.id.jd_zhpgjxz_img);
         sxZhpgjxzImg=(ImageView)findViewById(R.id.sx_zhpgjxz_img);
         sjZhpgjxzText=(TextView)findViewById(R.id.sj_zhpgjxz_text);
         jdShqrjxzImg=(ImageView)findViewById(R.id.jd_shqrjxz_img);
         jdShqrjxzTitle=(TextView)findViewById(R.id.jd_shqrjxz_title);
         sxShqrjxzImg=(ImageView)findViewById(R.id.sx_shqrjxz_img);
         sjShqrjxzText=(TextView)findViewById(R.id.sj_shqrjxz_text);
         jdFfjdzjzImg=(ImageView)findViewById(R.id.jd_ffjdzjz_img);
         sxFfjdzjzImg=(ImageView)findViewById(R.id.sx_ffjdzjz_img);
         sjFfjdzjzText=(TextView)findViewById(R.id.sj_ffjdzjz_text);
         jdFfjdzjzTitle=(TextView)findViewById(R.id.jd_ffjdzjz_title);
         jdYwjImg=(ImageView)findViewById(R.id.jd_ywj_img);
         jdYwjTitle=(TextView)findViewById(R.id.jd_ywj_title);
         sjYqxText=(TextView)findViewById(R.id.sj_yqx_text);
         buttonCancelRequest=(Button)findViewById(R.id.button_cancel_request);
         textviewDataNull=(TextView)findViewById(R.id.textview_data_null);
         loanApplyInfoRelativeLayout=(RelativeLayout)findViewById(R.id.loan_apply_info_relativeLayout);
        //查询借款进度接口
        showWaitDialog();
        checkLoanApply();
        loanApplyInfoRelativeLayout.setOnClickListener(this);
        buttonCancelRequest.setOnClickListener(this);

    }


    @Override
    public void onClick(View v) {
       if(R.id.button_cancel_request==v.getId()) {
           //取消按钮
           if (CheckUtils.checkUserState(this)) {
               return;
           }
           new AlertDialog.Builder(this).setTitle("确认取消借款申请吗？")
                   .setIcon(android.R.drawable.ic_dialog_info)
                   .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                       @Override
                       public void onClick(DialogInterface dialog, int which) {
                           // 点击“确认”后的操作
                           cancelLoanApply();
                       }
                   })
                   .setNegativeButton("返回", new DialogInterface.OnClickListener() {
                       @Override
                       public void onClick(DialogInterface dialog, int which) {
                           // 点击“返回”后的操作,这里不设置没有任何操作
                       }
                   }).show();
       }
        else if(R.id.loan_apply_info_relativeLayout==v.getId()){

                Intent loanApplyInfoIntent = new Intent(this, ApplyLoanInfoActivity.class);
                loanApplyInfoIntent.putExtra("loanApply", loanApply);
                startActivity(loanApplyInfoIntent);
        }
    }
}
